import { createApp } from 'vue'
import { createPinia } from 'pinia'
import pluginState from 'pinia-plugin-persistedstate'
import App from './App.vue'
import router from './router'
import AntdVue from 'ant-design-vue'
import '@/permission'
import 'ant-design-vue/dist/antd.less'
import '@/styles/index.less'

import {
  HomeOutlined,
  PartitionOutlined,
  SettingOutlined,
  TeamOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  PoweroffOutlined,
  LockOutlined,
  DownOutlined,
} from '@ant-design/icons-vue'

const icons = [
  HomeOutlined,
  PartitionOutlined,
  SettingOutlined,
  TeamOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  PoweroffOutlined,
  LockOutlined,
  DownOutlined,
]

const app = createApp(App)

app.use(AntdVue)
app.use(createPinia().use(pluginState))
app.use(router)

console.log(icons)
icons.forEach((Com) => app.component(Com.displayName, Com))

app.mount('#app')
